<template>
  <div class="company-list-1">
    <div class="header">巡查重点关注养户</div>
    <div class="content" v-if="props.info.length">
      <div class="content-item" v-for="(item, index) in props.info" :key="index">
        <div class="content-item-title">{{ item.rearerName }}</div>
        <div class="content-item-info">
          <div class="label">近一周告警事件 &nbsp;&nbsp;</div>
          <div class="value">{{ item.num }}</div>
        </div>
      </div>
    </div>
    <Empty type="text" v-else></Empty>
  </div>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'

const props = defineProps({
  info: {
    type: Array,
    default: () => []
  }
})

// 斑马纹
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 == 0) {
    return ''
  } else {
    return 'warning-row'
  }
}
</script>

<style scoped lang="scss">
@import '@/assets/table.css';

.company-list-1 {
  background-color: rgba(0, 0, 0, 0.1);
  height: 140px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  font-size: 16px;

  .header {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    background: url('@/assets/task/u1289.png') no-repeat center top;
    display: flex;
    justify-content: center;
    line-height: 40px;
  }

  .content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px;

    &-item {
      border: 1px solid rgba(35, 145, 255, 0.25);
      height: 80px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 10px;
      color: rgba(255, 255, 255, 0.5);

      &-title {
        line-height: 30px;
      }

      &-info {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .value {
          color: #fff;
          font-size: 24px;
        }
      }
    }

    .bg-green {
      background-image: url('@/assets/green1.svg'), url('@/assets/green2.svg');
    }

    .bg-blue {
      background-image: url('@/assets/blue1.svg'), url('@/assets/blue2.svg');
    }

    .bg-orange {
      background-image: url('@/assets/orange1.svg'), url('@/assets/orange2.svg');
    }
  }
}
</style>
